/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2012
 */

package com.smg.community.model;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import javacommon.base.*;

/**
 * @author badqiu email:badqiu(a)gmail.com
 * @version 1.0
 * @since 1.0
 */


public class CrmRole extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "CrmRole";
	public static final String ALIAS_ID = "id";
	public static final String ALIAS_NAME = "name";
	public static final String ALIAS_ROLE_DESC = "roleDesc";
	public static final String ALIAS_FLAG = "flag";
	public static final String ALIAS_BUTTONS = "buttons";
	
	//date formats
	
	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * id       db_column: id 
     */	
	private java.lang.Integer id;
    /**
     * name       db_column: name 
     */	
	private java.lang.String name;
    /**
     * roleDesc       db_column: roleDesc 
     */	
	private java.lang.String roleDesc;
	/**
     * flag       db_column: flag 
     */	
	private java.lang.Integer flag;
	 /**
     * buttons       db_column: buttons 
     */	
	public java.lang.String buttons;
	//columns END

	public java.lang.String getButtons() {
		return buttons;
	}

	public void setButtons(java.lang.String buttons) {
		this.buttons = buttons;
	}

	public CrmRole(){
	}

	public CrmRole(
		java.lang.Integer id
	){
		this.id = id;
	}

	public void setId(java.lang.Integer value) {
		this.id = value;
	}
	
	public java.lang.Integer getId() {
		return this.id;
	}
	public void setName(java.lang.String value) {
		this.name = value;
	}
	
	public java.lang.String getName() {
		return this.name;
	}
	public void setRoleDesc(java.lang.String value) {
		this.roleDesc = value;
	}
	
	public java.lang.String getRoleDesc() {
		return this.roleDesc;
	}
	public void setFlag(java.lang.Integer value) {
		this.flag = value;
	}
	
	public java.lang.Integer getFlag() {
		return this.flag;
	}
	
	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Name",getName())
			.append("RoleDesc",getRoleDesc())
			.append("Flag",getFlag())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof CrmRole == false) return false;
		if(this == obj) return true;
		CrmRole other = (CrmRole)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

